package com.java1412.config;

import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author java1412
 * @create 2021-05-13 16:49
 */
// @Configuration
public class DefaultViewConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 这里的"/"是访问路径，"forward:home.html"是请求转发到的页面名称
        registry.addViewController("/").setViewName("forward:home.html");
        // 设置优先级
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }
}
